/*
 * INode.h
 *
 *  Created on: Jul 7, 2009
 *      Author: elkobir
 */

#ifndef INODE_H_
#define INODE_H_

#include "Utils.h"
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <vector>
#include <sstream>
#include "INodeIndirect.h"
#include "Utils.h"
#include "Log.h"
using namespace std;

#define FILE 0
#define DIRECTORY 1
#define SOFTLINK 2

class INode {

private:
	int _fileType;
	unsigned int _hardLinksNum;
	int _fileSize;

public:
	INode(unsigned char* data);
	INode();
	virtual ~INode();

	int getType();
	void setType(int type);
	int getHardLinksNum();
	int incHardLinksNum();
	int decHardLinksNum();
	void setHardLinksNum(int num);
	int getFileSize();
	void setFileSize(int fileSize);
	int getDataBlockAt(int index);
	void setDataBlockAt(int index, int dblockNum);

	unsigned char* toBytes();
	vector<int>* getBlockList(int blockSize, unsigned char* indirectBytes);

	vector<int> _direct;
	int _indirect;
};

#endif /* INODE_H_ */
